package org.yumeko.jedis;

import org.junit.jupiter.api.Test;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisClientConfig;

public class Connet {
    @Test
    public void textConne(){
    //与Redis建立连接 IP+port
        Jedis redis = new Jedis("192.168.88.135", 6379);
        redis.auth("yumeko");
        //在Redis中写字符串 key value
        redis.set("jedis:name:1","jd-zhangfei");
        //获得Redis中字符串的值
        System.out.println(redis.get("jedis:name:1"));
        //在Redis中写list
        redis.lpush("jedis:list:1","1","2","3","4","5");
        //获得list的长度
        System.out.println(redis.llen("jedis:list:1"));
    }
}
